package com.fyzk.view;

import android.content.Context;

/**
 * Created by fanxs11 on 2017/7/11.
 */

public class DeviceUtils {

    public static int getStatuBarHeight(Context context) {
        int statusBarHeight = -1;
//获取status_bar_height资源的ID
        int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            //根据资源ID获取响应的尺寸值
            statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
        }
        return statusBarHeight;
    }
}
